<template>
	<view class="page" :style="{height:windowHeight+'px'}">

		<!-- <view class="head">
			<view class="head-item">
				<image src="../../../static/whiBg.png" @click="gotoPage('/pages/user/index/index')"></image>
				<view>我的钱包</view>
			</view>
			<view class="head-item2">
				<view class="balance">
					<text>账户余额 (元)</text>
					<view>00.00</view>
				</view>
				<view class="earnings">
					<view class="earnings-item">
						<text>昨日收益</text>
						<view>+00.00</view>
					</view>
					<view class="earnings-item">
						<text>本月收益</text>
						<view>+00.00</view>
					</view>
				</view>
			</view>
		</view>
		<view class="integral">
			<view class="integral-item">
				<image src="../../../static/jif.png"></image>
				<text>我的积分</text>
			</view>
			<view class="integralNum">00.00</view>
		</view> -->
		<view class="head">
			<view class="head-item">
				<image src="../../../static/whiBg.png" @click="gotoPage('/pages/user/index/index')"></image>
				<view>我的钱包</view>
			</view>
			<view class="head-item2">
				<view class="balance">
					<text>账户余额 (元)</text>
					<view class="payBox">
						<text class="balanceNum">{{tableData.balance}}</text>
						<view class="pay" @click="gotoPage('/pages/user/my-wallet/skype/skype')">立即充值</view>
					</view>
				</view>
				<view class="earnings">
					<view class="earnings-item">
						<text>昨日收益</text>
						<view>+{{tableData.yesterdayEarnings}}</view>
					</view>
					<view class="earnings-item">
						<text>本月收益</text>
						<view>+{{tableData.thisEarnings}}</view>
					</view>
				</view>
			</view>
		</view>
		<view class="integral">
			<view class="integral-item">
				<image src="../../../static/jif.png"></image>
				<text>我的积分</text>
			</view>
			<view class="integralNum">{{tableData.integral}}</view>
		</view>
		<view class="skype">
			<view class="skype-item">				
				<text>充值记录</text>
			</view>
			<image @click="gotoPage('/pages/user/my-wallet/skype_order/skype_order')" src="../../../static/jiantou3.png"></image>
		</view>
		<!-- 没有记录 -->
		<!-- <view class="d-c-c p30" v-if="tableData.length == 0 && !loading">
			<text class="iconfont icon-wushuju"></text>
			<text class="cont">亲，暂无相关记录哦</text>
		</view>
		<uni-load-more v-else :loadingType="loadingType"></uni-load-more> -->
	</view>
</template>

<script>
	import uniLoadMore from '@/components/uni-load-more.vue';
	export default {
		components: {
			uniLoadMore
		},
		data() {
			return {
				/*是否加载完成*/
				loading: false,
				/*手机高度*/
				windowHeight: 0,
				tableData: ''
			};
		},
		computed: {
			// /*加载中状态*/
			// loadingType() {
			// 	if (this.loading) {
			// 		return 1;
			// 	} else {
			// 		if (this.tableData.length != 0 && this.no_more) {
			// 			return 2;
			// 		} else {
			// 			return 0;
			// 		}
			// 	}
			// }
		},
		onLoad() {
			/*获取数据*/
			this.getData();
			uni.getSystemInfo({
				success: (res) => {
					this.windowHeight = res.windowHeight;
				}
			});
		},
		onPullDownRefresh() {
			this.getData();
			setTimeout(() => {
				uni.stopPullDownRefresh();
			}, 1000);
		},
		methods: {
			/*获取数据*/
			getData() {
				let self = this;
				uni.showLoading({
					title: '加载中'
				});
				self._get(
					'user.index/my_money', {

					},
					function(data) {
						//console.log(data);
						self.tableData = data.data.list
						//this.loading = true;
						uni.hideLoading();
					}
				);
			},
			/*跳转页面*/
			gotoPage(path) {
				let self = this;
				if (path.startsWith('/')) {
					uni.navigateTo({
						url: path
					});
				} else {
					self[path]();
				}
			},
		}
	};
</script>

<style>
	.page {
		width: 100%;
		height: 400rpx;
		background-color: #F4F4F4;
		overflow: hidden;
	}

	.head {
		width: 100%;
		height: 340rpx;
		background: url(../../../static/app/user/bg.png) 0 0/100% 100%;
	}

	.head-item {
		color: #FFFFFF;
		display: flex;
		align-items: center;
		padding: 80rpx 40rpx;
		font-size: 30rpx;
	}

	.head-item image {
		width: 17rpx;
		height: 30rpx;
		margin-right: 260rpx;
	}

	.head-item2 {
		width: 90%;
		padding: 40rpx 26rpx;
		margin: 20rpx auto 0rpx;
		border-radius: 10rpx;
		/* height: 200rpx; */
		background-color: #FFFFFF;
		padding-right: 0;
	}

	.balanceNum {
		margin: 6rpx 0;
		font-size: 50rpx;
		font-weight: 800;
		color: #0368ff;
	}

	.payBox {
		display: flex;
		align-items: center;
		justify-content: space-between;
	}

	.pay {
		margin-top: 10rpx;
		margin-left: 20rpx;
		width: 140rpx;
		height: 58rpx;
		border-radius: 140rpx  0 0 140rpx;
		line-height: 58rpx;
		text-align: center;
		background: linear-gradient(to right, #5864FD, #848DFF);
		color: #FFFFFF;
	}

	.earnings,
	.earnings-item {
		margin-top: 10rpx;
		display: flex;
		margin-right: 40rpx;
		align-items: center;
	}

	.earnings-item view {
		font-weight: 900;
		font-size: 30rpx;
	}

	.earnings-item text {
		color: #6f6f6f;
		margin-right: 10rpx;
	}

	.integral ,.skype{
		width: 88%;
		padding: 26rpx 26rpx;
		margin: 160rpx auto 0;
		background-color: #FFFFFF;
		display: flex;
		justify-content: space-between;
		align-items: center;
		border-radius: 10rpx;
	}

	.integral-item {
		display: flex;
		font-size: 26rpx;
	}

	.integral-item image {
		width: 40rpx;
		height: 40rpx;
		margin-right: 10rpx;
		margin-top: -4rpx;
	}

	.integralNum {
		font-size: 26rpx;
		font-weight: 700;
	}
	.skype{
		padding: 26rpx 26rpx;
		margin: 30rpx auto 0;
		display: flex;
		align-items: center;
		justify-content: space-between;
		border-radius: 10rpx;
		font-size: 30rpx;
		color: #646464;
	}
	.skype image{
		width: 46rpx;
		height: 46rpx;
	}
</style>
